package com.wfg.blog.contorller;

import com.wfg.blog.dao.pojo.SysUser;
import com.wfg.blog.service.SysUserService;
import com.wfg.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("users")
public class UsersController {

    @Autowired
    private SysUserService sysUserService;

    ///users/currentUser
    //通过token获取信息 访问接口时需要请求头
    @GetMapping("currentUser")
    public Result currentUser(@RequestHeader("Authorization") String token ){
        return sysUserService.findUserByToken(token);
    }
}
